Justifying the Correctness of the Fibonacci Sequence and the Euclide Algorithm by Loop-Invariant

نویسنده

  • Jing-Chao Chen
چکیده

If a loop-invariant exists in a loop program, computing its result by loop-invariant is simpler and easier than computing its result by the inductive method. For this purpose, the article describes the premise and the final computation result of the program such as “while<0”, “while>0”, “while<>0” by loop-invariant. To test the effectiveness of the computation method given in this article, by using loop-invariant of the loop programs mentioned above, we justify the correctness of the following three examples: Summing n integers (used for testing “while>0”), Fibonacci sequence (used for testing “while<0”), Greatest Common Divisor, i.e. Euclide algorithm (used for testing “while<>0”).

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Justifying the Correctness of the Fibonacci Sequence and the Euclide Algorithm by Loop-Invariant1

If a loop-invariant exists in a loop program, computing its result by loopinvariant is simpler and easier than computing its result by the inductive method. For this purpose, the article describes the premise and the final computation result of the program such as “while<0”, “while>0”, “while<>0” by loop-invariant. To test the effectiveness of the computation method given in this article, by us...

متن کامل

Ranking of Fire Stations with Fibonacci Sequence Technique, Case Study: District Ten of Tehran Municipality

One of the effective items to reduce time for arriving fire fighters to place of event is determining the optimal location of fire stations. Ranking can define the best location of a fire station through the available options. The case of this study is the district ten of Tehran municipality. That is the smallest district of Tehran municipality in terms of size and is highest in terms of densit...

متن کامل

A Generalized Fibonacci Sequence and the Diophantine Equations $x^2pm kxy-y^2pm x=0$

In this paper some properties of a generalization of Fibonacci sequence are investigated. Then we solve the Diophantine equations $x^2pmkxy-y^2pm x=0$, where $k$ is positive integer, and describe the structure of solutions.

متن کامل

A Class of Convergent Series with Golden Ratio Based on Fibonacci Sequence

In this article, a class of convergent series based on Fibonacci sequence is introduced for which there is a golden ratio (i.e. $frac{1+sqrt 5}{2}),$ with respect to convergence analysis. A class of sequences are at first built using two consecutive numbers of Fibonacci sequence and, therefore,  new sequences have been used in order  to introduce a  new class of series. All properties of the se...

متن کامل

Toeplitz transforms of Fibonacci sequences

We introduce a matricial Toeplitz transform and prove that the Toeplitz transform of a second order recurrence sequence is another second order recurrence sequence. We investigate the injectivity of this transform and show how this distinguishes the Fibonacci sequence among other recurrence sequences. We then obtain new Fibonacci identities as an application of our transform.

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007